package cn.edu.zut.hkxy.pojo;

import java.util.List;

public class PageBean {
    //当前页码
    private int currentPageNum;
    //起始索引值
    private int startIndex;
    //每页显示多少条数据
    private int pageSize;
    //总记录数
    private int total;
    //总页数
    private int totalPage;
    //本页的数据列表
    private List recordList;

    public PageBean(){}

    public PageBean(int currentPageNum, int pageSize, int total, List recordList) {
        this.currentPageNum = currentPageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.recordList = recordList;
        this.startIndex=(currentPageNum-1)*pageSize;
        this.totalPage=total%pageSize==0?total/pageSize:total/pageSize+1;
    }

    public int getCurrentPageNum() {
        return currentPageNum;
    }

    public void setCurrentPageNum(int currentPageNum) {
        this.currentPageNum = currentPageNum;
    }

    public int getStartIndex() {
        return (currentPageNum-1)*pageSize;
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTotalPage() {
        return total%pageSize==0?total/pageSize:total/pageSize+1;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List getRecordList() {
        return recordList;
    }

    public void setRecordList(List recordList) {
        this.recordList = recordList;
    }
}
